import { BaseService, Service, Permission } from '@/cool';

@Service('crm/home')
export default class extends BaseService {
	constructor() {
		super();
		this.topProduct = this.topProduct.bind(this);
		this.topPosition = this.topPosition.bind(this);
		this.topStaff = this.topStaff.bind(this);
		this.topGroup = this.topGroup.bind(this);
		this.topRelation = this.topRelation.bind(this);
	}
	@Permission('topProduct')
	topProduct(params) {
		return this.request({
			url: '/topProduct',
			params: {
				...params
			}
		});
	}
	@Permission('topPosition')
	topPosition(params) {
		return this.request({
			url: '/topPosition',
			params: {
				...params
			}
		});
	}
	@Permission('topStaff')
	topStaff(params) {
		return this.request({
			url: '/topStaff',
			params: {
				...params
			}
		});
	}
	@Permission('topGroup')
	topGroup(params) {
		return this.request({
			url: '/topGroup',
			params: {
				...params
			}
		});
	}
	@Permission('topRelation')
	topRelation(params) {
		return this.request({
			url: '/topRelation',
			params: {
				...params
			}
		});
	}
}
